<template>
  <div class="boxs">
    <div class="boxs-top"><titles :title="props.info.text" /> <textMax :data="props.info.remarks" :maxLen="80" /></div>
    <t-row :gutter="20">
      <t-col :span="4">
        <div class="items-box" @click="pathChild(props.info.children[0])">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[0].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[0].remarks }}</span
            >
          </div>
          <img
            class="box-img"
            :src="urls + props.info.children[0].value + '?imageView2/1/w/480/h/244/format/webp'"
            alt=""
            v-if="props.info.children[0].value"
          />
          <img class="box-img" src="http://101.34.143.36:8890/api/image/387939155165253/h_244,w_480" alt="" v-else />
        </div>
      </t-col>
      <t-col :span="8">
        <div class="items-box" @click="pathChild(props.info.children[1])">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[1].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[1].remarks }}</span
            >
          </div>
          <img
            class="box-img"
            :src="urls + props.info.children[1].value + '?imageView2/1/w/680/h/244/format/webp'"
            alt=""
            v-if="props.info.children[1].value"
          />
          <img
            @click="pathChild(props.info.children[1])"
            class="box-img"
            src="http://101.34.143.36:8890/api/image/387939155165253/h_244,w_680"
            alt=""
            v-else
          />
        </div>
      </t-col>
    </t-row>
    <t-row :gutter="20">
      <t-col :span="8">
        <div class="items-box" @click="pathChild(props.info.children[2])">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[2].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[2].remarks }}</span
            >
          </div>
          <img
            class="box-img"
            :src="urls + props.info.children[2].value + '?imageView2/1/w/680/h/244/format/webp'"
            alt=""
            v-if="props.info.children[2].value"
          />
          <img
            @click="pathChild(props.info.children[2])"
            class="box-img"
            src="http://101.34.143.36:8890/api/image/387939155165253/h_244,w_680"
            alt=""
            v-else
          />
        </div>
      </t-col>
      <t-col :span="4">
        <div class="items-box" @click="pathChild(props.info.children[3])">
          <div class="text-box">
            <span
              class="title"
              :style="{
                fontSize: store.styleInfo.mintitleSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[3].text }}</span
            >
            <span
              class="left-title1"
              :style="{
                fontSize: store.styleInfo.contentSize,
                fontFamily: store.styleInfo.textFamily,
                color: '#fff',
              }"
              >{{ props.info.children[3].remarks }}</span
            >
          </div>
          <img
            @click="pathChild(props.info.children[3])"
            class="box-img"
            :src="urls + props.info.children[3].value + '?imageView2/1/w/480/h/244/format/webp'"
            alt=""
            v-if="props.info.children[3].value"
          />
          <img
            @click="pathChild(props.info.children[3])"
            class="box-img"
            src="http://101.34.143.36:8890/api/image/387939155165253/h_244,w_480"
            alt=""
            v-else
          />
        </div>
      </t-col>
    </t-row>
  </div>
</template>

<script setup lang="ts">
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
import UnitImageNull from '@/components/unitImageNull/unitImageNull.vue';
const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const props = defineProps({
  info: {
    type: Object,
  },
});
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.boxs {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.boxs-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 50px;
}
.box-img {
  width: 100%;
  // height: auto;
  height: 244px;
}
.t-col {
  margin: 0;
}
.items-box {
  position: relative;
  width: 100%;
  height: 244px;
}
.text-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  .title {
  }
  .left-title1 {
    line-height: 28px;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden; //溢出内容隐藏
    text-overflow: ellipsis; //文本溢出部分用省略号表示
    display: -webkit-box; //特别显示模式
    -webkit-line-clamp: 3; //行数
    line-clamp: 3;
    -webkit-box-orient: vertical; //盒子中内容竖直排列
  }
}
.items-box:hover {
  .text-box {
    opacity: 1;
  }
}
</style>
